package org.csmzxy.class2334.timeclass;

import java.time.LocalTime;

public class Example12 {
    public static void main(String[] args){
        LocalTime nowTime = LocalTime.now();
        LocalTime of = LocalTime.of (17,23,15);
        System.out.println("当前时间的小时数："+ nowTime.getHour());
        System.out.println("当前时间的分钟数："+ nowTime.getMinute());
        System.out.println("时间of是否在now 之前：" + of.isBefore(nowTime));
        System.out.println("时间of 是否在now之后：" + of.isAfter(nowTime));
        System.out.println("将时间字符串解析成日期对象的结果为" + LocalTime.parse("18:05:50"));
        System.out.println("从LocalTime 获取不包含纳秒数的当前时间:" + nowTime.withNano(0));
    }
}
